<html><head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="script/json2.js"></script>
<script type="text/javascript" src="script/swfobject.js"></script>
<script type="text/javascript" src="http://localhost:8080/ofc/script/jquery.js"></script>
<script type="text/javascript" src="js/public.js"></script>
<script type="text/javascript">

$(function(){
 swfobject.embedSWF("script/open-flash-chart.swf", "my_chart", "950", "450", "9.0.0","expressInstall.swf",{"data-file":"http://localhost:8080/ofc/data-files/test-bug.txt"});
});

function ofc_ready()
{
	alert('ofc_ready');
}

function ajaxOFC(){
	$.ajax( {
		url : "http://localhost:8080/ofc/ofc/chart.jsp",
		dataType : "text",
		type : "GET",
		data : "r=" + Math.random(),
		error : function(req, msg, errmsg) {
			req.abort();
		},
		success : function(msg) {
				var tmp = findSWF("my_chart");
				if(msg!=''){
				tmp.load(msg);
				}
			}
		}
	);
	window.setTimeout("ajaxOFC();",1000);
}

function load_1()
{
	tmp = findSWF("my_chart");
	//x = tmp.load( JSON.stringify(chart) );
	x=tmp.reload("data-files/test-bug.txt");
}

function load_2()
{
	tmp = findSWF("my_chart");
	//x = tmp.load( JSON.stringify(chart2) );
	x=tmp.reload("data-files/1.txt");
}

function load_3()
{
    tmp = findSWF("my_chart");
    x = tmp.reload( "data-files/2.txt" );
}

function findSWF(movieName) {
  if (navigator.appName.indexOf("Microsoft")!= -1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}

</script>
</head>
  <body style="align:center">    
      	
       <div style="width:0px;height:0px;float:left;border:2px solid #C0C0C0;align=center;" > 	                    
         <div id="my_chart">Loading...</div>       
       </div>       
      <center>
       <table>
       <tr>
          <td>
          <INPUT TYPE=BUTTON OnClick="load_1();" VALUE="Chart 1">
          </td>
          <td>
          <INPUT TYPE=BUTTON OnClick="load_2();" VALUE="Chart 2">
          </td>
          <td>
          <INPUT TYPE=BUTTON OnClick="load_3();" VALUE="Chart 3">
          </td>
          <td>
          <INPUT TYPE=BUTTON onclick="javascript:ajaxOFC();" VALUE="Chart 4">
          </td>
        </tr>
       </table>
       </center>
  </body>
</html>